<%--
  Created by IntelliJ IDEA.
  User: 29265
  Date: 2024/12/25
  Time: 19:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>活动列表页面</title>
    <style>
        /* 页面整体背景颜色及字体设置 */
        body, html {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
            background-color: #f4f4f4;
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        /* 表格容器样式 */
        .table-container {
            max-width: 800px;
            width: 100%;
            margin: 20px auto;
            background-color: white;
            padding: 20px;
            border-radius: 10px;
            box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
        }
        /* 标题样式 */
        h1 {
            text-align: center;
            margin-bottom: 20px;
            color: #333;
        }
        /* 操作链接样式 */
        .action-link {
            display: block;
            margin-bottom: 20px;
            text-align: right;
        }
        .action-link a {
            text-decoration: none;
            color: #007bff;
            transition: color 0.3s;
        }
        .action-link a:hover {
            color: #0056b3;
        }
        /* 表格样式 */
        table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 20px;
        }
        th, td {
            padding: 12px;
            text-align: left;
            border-bottom: 1px solid #ddd;
        }
        th {
            background-color: #f2f2f2;
            font-weight: bold;
        }
        tr:hover {
            background-color: #f9f9f9;
        }
        /* 奇数行背景色 */
        tr:nth-child(even) {
            background-color: #f2f2f2;
        }
        /* 参加按钮样式 */
        .join-button {
            background-color: #28a745;
            color: white;
            border: none;
            padding: 6px 12px;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s;
        }
        .join-button:hover {
            background-color: #218838;
        }
    </style>
</head>
<body>
<div class="table-container">
    <h1>活动列表</h1>
    <div class="action-link">
        <a href="UserActivityServlet?&opsCode=allActivity">全部活动</a>
    </div>
    <table>
        <thead>
        <tr>
            <th>序号</th>
            <th>活动名</th>
            <th>地点</th>
            <th>时间</th>
            <th>活动描述</th>
            <%--<th>操作</th>--%>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${activityList}" var="activity" varStatus="status">
            <tr>
                <td>${status.index + 1}</td>
                <td>${activity.activity_name}</td>
                <td>${activity.location}</td>
                <td>${activity.activity_time}</td>
                <td>${activity.activity_description}</td>
                <%--<td><button class="join-button">退出</button></td>--%>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
</body>
</html>